home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!cronkite!news
- From: Marco DeFreitas <mdefreitas@sikorsky.com>
- Subject: New operator
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <1996Feb14.022723.6407@cronkite.res.utc.com>
- Sender: news@cronkite.res.utc.com
- Nntp-Posting-Host: iris604.asi.sikorsky.com
- Content-Transfer-Encoding: 7bit
- Organization: Sikorsky Aircraft
- Mime-Version: 1.0
- Date: Wed, 14 Feb 1996 02:27:23 GMT
- X-Mailer: Mozilla 1.1S (X11; I; IRIX 5.3 IP12)
- X-Url: news:comp.lang.c++
-
- If I use the explicit placement form of new to create an object from
- some specified memory, can I delete it?
-
- char buf[100];
- Object *obj;
-
- obj = new (buf) Object;
- delete obj;
-
-
- What actually happens? I tried it on an SGI version of C++ and it does
- not complain - but is this legal? Is it really doing a delete of my buf?
- Or is the delete being ignored. Thanks in advance for any input.
-
- --
- Regards,
- Marco DeFreitas
- Sikorsky Aircraft
- Stratford, CT
-
-